package com.bjpowernode.controller;

import com.bjpowernode.entity.TProduct;
import com.bjpowernode.result.Result;
import com.bjpowernode.service.ProductService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProductController {

    @Resource
    private ProductService productService;

    @GetMapping("/api/products")
    public Result getProducts() {
        List<TProduct> products = productService.getProducts();
        return Result.OK(products);
    }
}
